/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.asseco.mio.codex;

import java.util.Date;
import javax.persistence.*;
import org.appfuse.model.BaseObject;
import org.hibernate.annotations.GenericGenerator;


/**
 *
 * @author filip.apostolski
 */
@Entity @Table(name="NATIONALITY")
public class Nationality  extends BaseObject {
    
    private String id;
    private String nationalityName;
    private String nationalityCode;
    private String nationalityDescr;
    private Boolean status = true;
    private Date activeDate;
    private Date passiveDate;

    @Column(name = "ACTIVE_DATE")
    @Temporal(value = javax.persistence.TemporalType.TIMESTAMP)
    public Date getActiveDate() {
        return activeDate;
    }

    public void setActiveDate(Date activeDate) {
        this.activeDate = activeDate;
    }

    @Column(name = "NATIONALITY_CODE", length = 255)
    public String getNationalityCode() {
        return nationalityCode;
    }

    public void setNationalityCode(String nationalityCode) {
        this.nationalityCode = nationalityCode;
    }

    @Column(name = "NATIONALITY_DESCR", length = 4096)
    public String getNationalityDescr() {
        return nationalityDescr;
    }

    public void setNationalityDescr(String nationalityDescr) {
        this.nationalityDescr = nationalityDescr;
    }
@Id
    @GeneratedValue(generator = "system-uuid")
    @Column(name = "ID", length = 255)
    @GenericGenerator(name="system-uuid", strategy = "uuid")
    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    @Column(name = "NATIONALITY_NAME", length = 1000)
    public String getNationalityName() {
        return nationalityName;
    }

    public void setNationalityName(String nationalityName) {
        this.nationalityName = nationalityName;
    }

    @Column(name = "PASSIVE_DATE")
    @Temporal(value = javax.persistence.TemporalType.TIMESTAMP)
    public Date getPassiveDate() {
        return passiveDate;
    }

    public void setPassiveDate(Date passiveDate) {
        this.passiveDate = passiveDate;
    }

    @Column(name = "STATUS")
    public Boolean getStatus() {
        return status;
    }

    public void setStatus(Boolean status) {
        this.status = status;
    }

    @Override
    public String toString() {
        return "Nationality{" + "id=" + id + "nationalityName=" + nationalityName + "nationalityCode=" + nationalityCode + "nationalityDescr=" + nationalityDescr + "status=" + status + "activeDate=" + activeDate + "passiveDate=" + passiveDate + '}';
    }

    

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final Nationality other = (Nationality) obj;
        if ((this.id == null) ? (other.id != null) : !this.id.equals(other.id)) {
            return false;
        }
        if ((this.nationalityName == null) ? (other.nationalityName != null) : !this.nationalityName.equals(other.nationalityName)) {
            return false;
        }
        if ((this.nationalityCode == null) ? (other.nationalityCode != null) : !this.nationalityCode.equals(other.nationalityCode)) {
            return false;
        }
        if ((this.nationalityDescr == null) ? (other.nationalityDescr != null) : !this.nationalityDescr.equals(other.nationalityDescr)) {
            return false;
        }
        if (this.status != other.status) {
            return false;
        }
        if (this.activeDate != other.activeDate && (this.activeDate == null || !this.activeDate.equals(other.activeDate))) {
            return false;
        }
        if (this.passiveDate != other.passiveDate && (this.passiveDate == null || !this.passiveDate.equals(other.passiveDate))) {
            return false;
        }
        return true;
    }

  

    @Override
    public int hashCode() {
        throw new UnsupportedOperationException("Not supported yet.");
    }
}
